/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - VoTransactionNote.as.
 */

package com.model.valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_VoTransactionNote extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
        try
        {
            if (flash.net.getClassByAlias("VoTransactionNote") == null)
            {
                flash.net.registerClassAlias("VoTransactionNote", cz);
            }
        }
        catch (e:Error)
        {
            flash.net.registerClassAlias("VoTransactionNote", cz);
        }
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _VoTransactionNoteEntityMetadata;

    /**
     * properties
     */
    private var _internal_note_code : String;
    private var _internal_cre_datetime : String;
    private var _internal_note_description : String;
    private var _internal_cre_userid_fk : int;
    private var _internal_remarks : ArrayCollection;
    private var _internal_pro_serialnumber_fk : ArrayCollection;
    private var _internal_detserialnumber : ArrayCollection;
    private var _internal_serialnumber : int;
    private var _internal_unit_price : ArrayCollection;
    private var _internal_client_serialnumber_fk : int;
    private var _internal_trans_note_header_fk : ArrayCollection;
    private var _internal_trans_serialnumber_fk : ArrayCollection;
    private var _internal_note_type : String;
    private var _internal_price : ArrayCollection;
    private var _internal_discount_or_tax : ArrayCollection;
    private var _internal_trans_qty : ArrayCollection;
    private var _internal_note_date : String;
    private var _internal_activestatus : Boolean;
    private var _internal_quantity : ArrayCollection;
    private var _internal_trans_type : String;
    private var _internal_client_name : String;

    private static var emptyArray:Array = new Array();


    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_VoTransactionNote()
    {
        _model = new _VoTransactionNoteEntityMetadata(this);

        // Bind to own data properties for cache invalidation triggering
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "note_code", model_internal::setterListenerNote_code));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "cre_datetime", model_internal::setterListenerCre_datetime));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "note_description", model_internal::setterListenerNote_description));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "remarks", model_internal::setterListenerRemarks));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_serialnumber_fk", model_internal::setterListenerPro_serialnumber_fk));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "detserialnumber", model_internal::setterListenerDetserialnumber));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "unit_price", model_internal::setterListenerUnit_price));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "trans_note_header_fk", model_internal::setterListenerTrans_note_header_fk));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "trans_serialnumber_fk", model_internal::setterListenerTrans_serialnumber_fk));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "note_type", model_internal::setterListenerNote_type));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "price", model_internal::setterListenerPrice));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "discount_or_tax", model_internal::setterListenerDiscount_or_tax));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "trans_qty", model_internal::setterListenerTrans_qty));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "note_date", model_internal::setterListenerNote_date));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "quantity", model_internal::setterListenerQuantity));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "trans_type", model_internal::setterListenerTrans_type));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "client_name", model_internal::setterListenerClient_name));

    }

    /**
     * data property getters
     */

    [Bindable(event="propertyChange")]
    public function get note_code() : String
    {
        return _internal_note_code;
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetime() : String
    {
        return _internal_cre_datetime;
    }

    [Bindable(event="propertyChange")]
    public function get note_description() : String
    {
        return _internal_note_description;
    }

    [Bindable(event="propertyChange")]
    public function get cre_userid_fk() : int
    {
        return _internal_cre_userid_fk;
    }

    [Bindable(event="propertyChange")]
    public function get remarks() : ArrayCollection
    {
        return _internal_remarks;
    }

    [Bindable(event="propertyChange")]
    public function get pro_serialnumber_fk() : ArrayCollection
    {
        return _internal_pro_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get detserialnumber() : ArrayCollection
    {
        return _internal_detserialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get serialnumber() : int
    {
        return _internal_serialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get unit_price() : ArrayCollection
    {
        return _internal_unit_price;
    }

    [Bindable(event="propertyChange")]
    public function get client_serialnumber_fk() : int
    {
        return _internal_client_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get trans_note_header_fk() : ArrayCollection
    {
        return _internal_trans_note_header_fk;
    }

    [Bindable(event="propertyChange")]
    public function get trans_serialnumber_fk() : ArrayCollection
    {
        return _internal_trans_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get note_type() : String
    {
        return _internal_note_type;
    }

    [Bindable(event="propertyChange")]
    public function get price() : ArrayCollection
    {
        return _internal_price;
    }

    [Bindable(event="propertyChange")]
    public function get discount_or_tax() : ArrayCollection
    {
        return _internal_discount_or_tax;
    }

    [Bindable(event="propertyChange")]
    public function get trans_qty() : ArrayCollection
    {
        return _internal_trans_qty;
    }

    [Bindable(event="propertyChange")]
    public function get note_date() : String
    {
        return _internal_note_date;
    }

    [Bindable(event="propertyChange")]
    public function get activestatus() : Boolean
    {
        return _internal_activestatus;
    }

    [Bindable(event="propertyChange")]
    public function get quantity() : ArrayCollection
    {
        return _internal_quantity;
    }

    [Bindable(event="propertyChange")]
    public function get trans_type() : String
    {
        return _internal_trans_type;
    }

    [Bindable(event="propertyChange")]
    public function get client_name() : String
    {
        return _internal_client_name;
    }

    /**
     * data property setters
     */

    public function set note_code(value:String) : void
    {
        var oldValue:String = _internal_note_code;
        if (oldValue !== value)
        {
            _internal_note_code = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "note_code", oldValue, _internal_note_code));
        }
    }

    public function set cre_datetime(value:String) : void
    {
        var oldValue:String = _internal_cre_datetime;
        if (oldValue !== value)
        {
            _internal_cre_datetime = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetime", oldValue, _internal_cre_datetime));
        }
    }

    public function set note_description(value:String) : void
    {
        var oldValue:String = _internal_note_description;
        if (oldValue !== value)
        {
            _internal_note_description = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "note_description", oldValue, _internal_note_description));
        }
    }

    public function set cre_userid_fk(value:int) : void
    {
        var oldValue:int = _internal_cre_userid_fk;
        if (oldValue !== value)
        {
            _internal_cre_userid_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_userid_fk", oldValue, _internal_cre_userid_fk));
        }
    }

    public function set remarks(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_remarks;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_remarks = value;
            }
            else if (value is Array)
            {
                _internal_remarks = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of remarks must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "remarks", oldValue, _internal_remarks));
        }
    }

    public function set pro_serialnumber_fk(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_pro_serialnumber_fk;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_pro_serialnumber_fk = value;
            }
            else if (value is Array)
            {
                _internal_pro_serialnumber_fk = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of pro_serialnumber_fk must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_serialnumber_fk", oldValue, _internal_pro_serialnumber_fk));
        }
    }

    public function set detserialnumber(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_detserialnumber;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_detserialnumber = value;
            }
            else if (value is Array)
            {
                _internal_detserialnumber = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of detserialnumber must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "detserialnumber", oldValue, _internal_detserialnumber));
        }
    }

    public function set serialnumber(value:int) : void
    {
        var oldValue:int = _internal_serialnumber;
        if (oldValue !== value)
        {
            _internal_serialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "serialnumber", oldValue, _internal_serialnumber));
        }
    }

    public function set unit_price(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_unit_price;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_unit_price = value;
            }
            else if (value is Array)
            {
                _internal_unit_price = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of unit_price must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "unit_price", oldValue, _internal_unit_price));
        }
    }

    public function set client_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_client_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_client_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "client_serialnumber_fk", oldValue, _internal_client_serialnumber_fk));
        }
    }

    public function set trans_note_header_fk(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_trans_note_header_fk;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_trans_note_header_fk = value;
            }
            else if (value is Array)
            {
                _internal_trans_note_header_fk = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of trans_note_header_fk must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_note_header_fk", oldValue, _internal_trans_note_header_fk));
        }
    }

    public function set trans_serialnumber_fk(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_trans_serialnumber_fk;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_trans_serialnumber_fk = value;
            }
            else if (value is Array)
            {
                _internal_trans_serialnumber_fk = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of trans_serialnumber_fk must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_serialnumber_fk", oldValue, _internal_trans_serialnumber_fk));
        }
    }

    public function set note_type(value:String) : void
    {
        var oldValue:String = _internal_note_type;
        if (oldValue !== value)
        {
            _internal_note_type = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "note_type", oldValue, _internal_note_type));
        }
    }

    public function set price(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_price;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_price = value;
            }
            else if (value is Array)
            {
                _internal_price = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of price must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "price", oldValue, _internal_price));
        }
    }

    public function set discount_or_tax(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_discount_or_tax;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_discount_or_tax = value;
            }
            else if (value is Array)
            {
                _internal_discount_or_tax = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of discount_or_tax must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "discount_or_tax", oldValue, _internal_discount_or_tax));
        }
    }

    public function set trans_qty(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_trans_qty;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_trans_qty = value;
            }
            else if (value is Array)
            {
                _internal_trans_qty = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of trans_qty must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_qty", oldValue, _internal_trans_qty));
        }
    }

    public function set note_date(value:String) : void
    {
        var oldValue:String = _internal_note_date;
        if (oldValue !== value)
        {
            _internal_note_date = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "note_date", oldValue, _internal_note_date));
        }
    }

    public function set activestatus(value:Boolean) : void
    {
        var oldValue:Boolean = _internal_activestatus;
        if (oldValue !== value)
        {
            _internal_activestatus = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "activestatus", oldValue, _internal_activestatus));
        }
    }

    public function set quantity(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_quantity;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_quantity = value;
            }
            else if (value is Array)
            {
                _internal_quantity = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of quantity must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "quantity", oldValue, _internal_quantity));
        }
    }

    public function set trans_type(value:String) : void
    {
        var oldValue:String = _internal_trans_type;
        if (oldValue !== value)
        {
            _internal_trans_type = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "trans_type", oldValue, _internal_trans_type));
        }
    }

    public function set client_name(value:String) : void
    {
        var oldValue:String = _internal_client_name;
        if (oldValue !== value)
        {
            _internal_client_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "client_name", oldValue, _internal_client_name));
        }
    }

    /**
     * Data property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */

    model_internal function setterListenerNote_code(value:flash.events.Event):void
    {
        _model.invalidateDependentOnNote_code();
    }

    model_internal function setterListenerCre_datetime(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCre_datetime();
    }

    model_internal function setterListenerNote_description(value:flash.events.Event):void
    {
        _model.invalidateDependentOnNote_description();
    }

    model_internal function setterListenerRemarks(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerRemarks);
            }
        }
        _model.invalidateDependentOnRemarks();
    }

    model_internal function setterListenerPro_serialnumber_fk(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPro_serialnumber_fk);
            }
        }
        _model.invalidateDependentOnPro_serialnumber_fk();
    }

    model_internal function setterListenerDetserialnumber(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerDetserialnumber);
            }
        }
        _model.invalidateDependentOnDetserialnumber();
    }

    model_internal function setterListenerUnit_price(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerUnit_price);
            }
        }
        _model.invalidateDependentOnUnit_price();
    }

    model_internal function setterListenerTrans_note_header_fk(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerTrans_note_header_fk);
            }
        }
        _model.invalidateDependentOnTrans_note_header_fk();
    }

    model_internal function setterListenerTrans_serialnumber_fk(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerTrans_serialnumber_fk);
            }
        }
        _model.invalidateDependentOnTrans_serialnumber_fk();
    }

    model_internal function setterListenerNote_type(value:flash.events.Event):void
    {
        _model.invalidateDependentOnNote_type();
    }

    model_internal function setterListenerPrice(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPrice);
            }
        }
        _model.invalidateDependentOnPrice();
    }

    model_internal function setterListenerDiscount_or_tax(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerDiscount_or_tax);
            }
        }
        _model.invalidateDependentOnDiscount_or_tax();
    }

    model_internal function setterListenerTrans_qty(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerTrans_qty);
            }
        }
        _model.invalidateDependentOnTrans_qty();
    }

    model_internal function setterListenerNote_date(value:flash.events.Event):void
    {
        _model.invalidateDependentOnNote_date();
    }

    model_internal function setterListenerQuantity(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerQuantity);
            }
        }
        _model.invalidateDependentOnQuantity();
    }

    model_internal function setterListenerTrans_type(value:flash.events.Event):void
    {
        _model.invalidateDependentOnTrans_type();
    }

    model_internal function setterListenerClient_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnClient_name();
    }


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;
        if (!_model.note_codeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_note_codeValidationFailureMessages);
        }
        if (!_model.cre_datetimeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_cre_datetimeValidationFailureMessages);
        }
        if (!_model.note_descriptionIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_note_descriptionValidationFailureMessages);
        }
        if (!_model.remarksIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_remarksValidationFailureMessages);
        }
        if (!_model.pro_serialnumber_fkIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_serialnumber_fkValidationFailureMessages);
        }
        if (!_model.detserialnumberIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_detserialnumberValidationFailureMessages);
        }
        if (!_model.unit_priceIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_unit_priceValidationFailureMessages);
        }
        if (!_model.trans_note_header_fkIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_trans_note_header_fkValidationFailureMessages);
        }
        if (!_model.trans_serialnumber_fkIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_trans_serialnumber_fkValidationFailureMessages);
        }
        if (!_model.note_typeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_note_typeValidationFailureMessages);
        }
        if (!_model.priceIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_priceValidationFailureMessages);
        }
        if (!_model.discount_or_taxIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_discount_or_taxValidationFailureMessages);
        }
        if (!_model.trans_qtyIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_trans_qtyValidationFailureMessages);
        }
        if (!_model.note_dateIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_note_dateValidationFailureMessages);
        }
        if (!_model.quantityIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_quantityValidationFailureMessages);
        }
        if (!_model.trans_typeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_trans_typeValidationFailureMessages);
        }
        if (!_model.client_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_client_nameValidationFailureMessages);
        }

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _VoTransactionNoteEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _VoTransactionNoteEntityMetadata) : void
    {
        var oldValue : _VoTransactionNoteEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }

    model_internal var _doValidationCacheOfNote_code : Array = null;
    model_internal var _doValidationLastValOfNote_code : String;

    model_internal function _doValidationForNote_code(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfNote_code != null && model_internal::_doValidationLastValOfNote_code == value)
           return model_internal::_doValidationCacheOfNote_code ;

        _model.model_internal::_note_codeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isNote_codeAvailable && _internal_note_code == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "note_code is required"));
        }

        model_internal::_doValidationCacheOfNote_code = validationFailures;
        model_internal::_doValidationLastValOfNote_code = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCre_datetime : Array = null;
    model_internal var _doValidationLastValOfCre_datetime : String;

    model_internal function _doValidationForCre_datetime(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCre_datetime != null && model_internal::_doValidationLastValOfCre_datetime == value)
           return model_internal::_doValidationCacheOfCre_datetime ;

        _model.model_internal::_cre_datetimeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCre_datetimeAvailable && _internal_cre_datetime == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "cre_datetime is required"));
        }

        model_internal::_doValidationCacheOfCre_datetime = validationFailures;
        model_internal::_doValidationLastValOfCre_datetime = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfNote_description : Array = null;
    model_internal var _doValidationLastValOfNote_description : String;

    model_internal function _doValidationForNote_description(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfNote_description != null && model_internal::_doValidationLastValOfNote_description == value)
           return model_internal::_doValidationCacheOfNote_description ;

        _model.model_internal::_note_descriptionIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isNote_descriptionAvailable && _internal_note_description == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "note_description is required"));
        }

        model_internal::_doValidationCacheOfNote_description = validationFailures;
        model_internal::_doValidationLastValOfNote_description = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfRemarks : Array = null;
    model_internal var _doValidationLastValOfRemarks : ArrayCollection;

    model_internal function _doValidationForRemarks(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfRemarks != null && model_internal::_doValidationLastValOfRemarks == value)
           return model_internal::_doValidationCacheOfRemarks ;

        _model.model_internal::_remarksIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isRemarksAvailable && _internal_remarks == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "remarks is required"));
        }

        model_internal::_doValidationCacheOfRemarks = validationFailures;
        model_internal::_doValidationLastValOfRemarks = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_serialnumber_fk : Array = null;
    model_internal var _doValidationLastValOfPro_serialnumber_fk : ArrayCollection;

    model_internal function _doValidationForPro_serialnumber_fk(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPro_serialnumber_fk != null && model_internal::_doValidationLastValOfPro_serialnumber_fk == value)
           return model_internal::_doValidationCacheOfPro_serialnumber_fk ;

        _model.model_internal::_pro_serialnumber_fkIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_serialnumber_fkAvailable && _internal_pro_serialnumber_fk == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_serialnumber_fk is required"));
        }

        model_internal::_doValidationCacheOfPro_serialnumber_fk = validationFailures;
        model_internal::_doValidationLastValOfPro_serialnumber_fk = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDetserialnumber : Array = null;
    model_internal var _doValidationLastValOfDetserialnumber : ArrayCollection;

    model_internal function _doValidationForDetserialnumber(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfDetserialnumber != null && model_internal::_doValidationLastValOfDetserialnumber == value)
           return model_internal::_doValidationCacheOfDetserialnumber ;

        _model.model_internal::_detserialnumberIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDetserialnumberAvailable && _internal_detserialnumber == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "detserialnumber is required"));
        }

        model_internal::_doValidationCacheOfDetserialnumber = validationFailures;
        model_internal::_doValidationLastValOfDetserialnumber = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfUnit_price : Array = null;
    model_internal var _doValidationLastValOfUnit_price : ArrayCollection;

    model_internal function _doValidationForUnit_price(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfUnit_price != null && model_internal::_doValidationLastValOfUnit_price == value)
           return model_internal::_doValidationCacheOfUnit_price ;

        _model.model_internal::_unit_priceIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isUnit_priceAvailable && _internal_unit_price == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "unit_price is required"));
        }

        model_internal::_doValidationCacheOfUnit_price = validationFailures;
        model_internal::_doValidationLastValOfUnit_price = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfTrans_note_header_fk : Array = null;
    model_internal var _doValidationLastValOfTrans_note_header_fk : ArrayCollection;

    model_internal function _doValidationForTrans_note_header_fk(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfTrans_note_header_fk != null && model_internal::_doValidationLastValOfTrans_note_header_fk == value)
           return model_internal::_doValidationCacheOfTrans_note_header_fk ;

        _model.model_internal::_trans_note_header_fkIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isTrans_note_header_fkAvailable && _internal_trans_note_header_fk == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "trans_note_header_fk is required"));
        }

        model_internal::_doValidationCacheOfTrans_note_header_fk = validationFailures;
        model_internal::_doValidationLastValOfTrans_note_header_fk = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfTrans_serialnumber_fk : Array = null;
    model_internal var _doValidationLastValOfTrans_serialnumber_fk : ArrayCollection;

    model_internal function _doValidationForTrans_serialnumber_fk(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfTrans_serialnumber_fk != null && model_internal::_doValidationLastValOfTrans_serialnumber_fk == value)
           return model_internal::_doValidationCacheOfTrans_serialnumber_fk ;

        _model.model_internal::_trans_serialnumber_fkIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isTrans_serialnumber_fkAvailable && _internal_trans_serialnumber_fk == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "trans_serialnumber_fk is required"));
        }

        model_internal::_doValidationCacheOfTrans_serialnumber_fk = validationFailures;
        model_internal::_doValidationLastValOfTrans_serialnumber_fk = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfNote_type : Array = null;
    model_internal var _doValidationLastValOfNote_type : String;

    model_internal function _doValidationForNote_type(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfNote_type != null && model_internal::_doValidationLastValOfNote_type == value)
           return model_internal::_doValidationCacheOfNote_type ;

        _model.model_internal::_note_typeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isNote_typeAvailable && _internal_note_type == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "note_type is required"));
        }

        model_internal::_doValidationCacheOfNote_type = validationFailures;
        model_internal::_doValidationLastValOfNote_type = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPrice : Array = null;
    model_internal var _doValidationLastValOfPrice : ArrayCollection;

    model_internal function _doValidationForPrice(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPrice != null && model_internal::_doValidationLastValOfPrice == value)
           return model_internal::_doValidationCacheOfPrice ;

        _model.model_internal::_priceIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPriceAvailable && _internal_price == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "price is required"));
        }

        model_internal::_doValidationCacheOfPrice = validationFailures;
        model_internal::_doValidationLastValOfPrice = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDiscount_or_tax : Array = null;
    model_internal var _doValidationLastValOfDiscount_or_tax : ArrayCollection;

    model_internal function _doValidationForDiscount_or_tax(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfDiscount_or_tax != null && model_internal::_doValidationLastValOfDiscount_or_tax == value)
           return model_internal::_doValidationCacheOfDiscount_or_tax ;

        _model.model_internal::_discount_or_taxIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDiscount_or_taxAvailable && _internal_discount_or_tax == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "discount_or_tax is required"));
        }

        model_internal::_doValidationCacheOfDiscount_or_tax = validationFailures;
        model_internal::_doValidationLastValOfDiscount_or_tax = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfTrans_qty : Array = null;
    model_internal var _doValidationLastValOfTrans_qty : ArrayCollection;

    model_internal function _doValidationForTrans_qty(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfTrans_qty != null && model_internal::_doValidationLastValOfTrans_qty == value)
           return model_internal::_doValidationCacheOfTrans_qty ;

        _model.model_internal::_trans_qtyIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isTrans_qtyAvailable && _internal_trans_qty == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "trans_qty is required"));
        }

        model_internal::_doValidationCacheOfTrans_qty = validationFailures;
        model_internal::_doValidationLastValOfTrans_qty = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfNote_date : Array = null;
    model_internal var _doValidationLastValOfNote_date : String;

    model_internal function _doValidationForNote_date(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfNote_date != null && model_internal::_doValidationLastValOfNote_date == value)
           return model_internal::_doValidationCacheOfNote_date ;

        _model.model_internal::_note_dateIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isNote_dateAvailable && _internal_note_date == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "note_date is required"));
        }

        model_internal::_doValidationCacheOfNote_date = validationFailures;
        model_internal::_doValidationLastValOfNote_date = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfQuantity : Array = null;
    model_internal var _doValidationLastValOfQuantity : ArrayCollection;

    model_internal function _doValidationForQuantity(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfQuantity != null && model_internal::_doValidationLastValOfQuantity == value)
           return model_internal::_doValidationCacheOfQuantity ;

        _model.model_internal::_quantityIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isQuantityAvailable && _internal_quantity == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "quantity is required"));
        }

        model_internal::_doValidationCacheOfQuantity = validationFailures;
        model_internal::_doValidationLastValOfQuantity = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfTrans_type : Array = null;
    model_internal var _doValidationLastValOfTrans_type : String;

    model_internal function _doValidationForTrans_type(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfTrans_type != null && model_internal::_doValidationLastValOfTrans_type == value)
           return model_internal::_doValidationCacheOfTrans_type ;

        _model.model_internal::_trans_typeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isTrans_typeAvailable && _internal_trans_type == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "trans_type is required"));
        }

        model_internal::_doValidationCacheOfTrans_type = validationFailures;
        model_internal::_doValidationLastValOfTrans_type = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfClient_name : Array = null;
    model_internal var _doValidationLastValOfClient_name : String;

    model_internal function _doValidationForClient_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfClient_name != null && model_internal::_doValidationLastValOfClient_name == value)
           return model_internal::_doValidationCacheOfClient_name ;

        _model.model_internal::_client_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isClient_nameAvailable && _internal_client_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "client_name is required"));
        }

        model_internal::_doValidationCacheOfClient_name = validationFailures;
        model_internal::_doValidationLastValOfClient_name = value;

        return validationFailures;
    }
    

}

}
